<template>
  <div>HOME</div>
</template>

<script>
export default {
  name: 'HomeView',
  // 生命周期钩子
  beforeUnmount(){
    console.log( '- - - [HomeView] before unmount - - -' );
  },
  // 生命周期钩子
  unmounted(){
    console.log( '- - - [HomeView] unmounted - - -' );
  },
  // 组件内守卫
  // 在导航离开渲染该组件的对应路由时调用
  beforeRouteLeave(to,from){
    console.log( '- - - [HomeView] before route leave - - -' );
    console.log( 'from: ' , from.path , ' , to: ' , to.path ); 
  }
}
</script>

<style>

</style>